import {createRouter, createWebHistory} from 'vue-router'
import ChatBase from '../components/chat-base.vue'
import Index from '@/views/index.vue'
import ChatKnowledge from '@/views/chat-knowledge.vue'
import ChatManage from '@/views/chat-manage.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'home',
            component: Index,
            redirect:'/chat/qa',
            children: [
                {
                    path: '/chat/qa',
                    name: 'chat-chat',
                    component: ChatBase,
                },
                {
                    path: '/chat/ck',
                    name: 'chat-repository',
                    component: ChatKnowledge,
                },
                {
                    path: '/chat/manage',
                    name: 'chat-manage',
                    component: ChatManage,
                },
                {
                    path:"/404",
                    name:"not found",
                    meta:{
                        title:"not found"
                    },
                    component:()=>import("@/components/not-found.vue")
                },
            ]
        },

        {
            path:"/:pathMatch(.*)*",
            redirect:"/404"
        }
    ],
})

export default router
